package com.jkl.comm.StringUtils;

public class StringUtils {
	
	 private static final char SEPARATOR = '_';
	 private static final String CHARSET_NAME = "UTF-8";
	/**
	 * 把数字转换为四位字符，如12转换为0012
	 * 
	 * @param conunt
	 * @return
	 */
	public static String changeNumberforString(Long count,int size) {
		String reslut = "";
		String max = String.valueOf(size*10*9);
		if (count < 9999) {
			if (String.valueOf(count).length() < size) {
				for (int i = 0; i < size - String.valueOf(count).length(); i++) {
					reslut += "0";
				}
				reslut += count;
			}else{
				reslut=String.valueOf(count);
			}
		} else {
			reslut = "999";
		}
		return reslut;
	}    
	/**
	  * 获取一个文件的后缀(带有点)
	  * 
	  * @param fileName
	  *            文件名
	  * @return 返回文件的后缀
	  */
	 public static String getExt(String fileName) {
	  int pos = fileName.lastIndexOf(".");
	  if (pos == -1)
	   return "";
	  return fileName.substring(pos, fileName.length());
	 }
}
